sending mail with images

sending mail with images

am 07.12.2006 19:29:01 von giorgio

Hi,
I'm using ASP 3 and I send mail with CDONTS.NewMail or CDO.Message.
If my mail contains some html code with images like , OE
blocks image's visualization.
If i want to avoid this, when i send my mail from OE i flag "send images
with message" option.
How can i realize this when i send the mail with ASP?

Thanks

Re: sending mail with images

am 07.12.2006 20:26:13 von giorgio

I'm looking AttachURL method.

objMail.AttachURL Source, ContentLocation

But it seems not to work if i put in Source a path like
http://www.google.it/intl/it_it/images/logo.gif

Re: sending mail with images

am 08.12.2006 10:24:50 von eddyger

Hi,
view below (i have tested it successfuly ):


messageHTML = "

"
messageHTML = .....

sendMailHtml("from@me.com" ,"to@you.com" , "TEST" , messageHTML)

Sub sendMailHtml(emetteur, destinataire, sujet, message)
Dim objMAIL
Dim cheminImage
Dim objShell

set objShell = CreateObject("WScript.Shell")
cheminImage = objShell.CurrentDirectory + "\" + IMAGEFILE

set objMAIL = CreateObject("CDO.Message")
objMAIL.From = emetteur
objMAIL.To = destinataire
objMAIL.Subject = sujet
objMAIL.HTMLBody = message

objMAIL.AddRelatedBodyPart cheminImage , IMAGEFILE ,
CDOCdoReferenceTypecdoRefTypeId

objMAIL.Configuration.Fields.Item
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMAIL.Configuration.Fields.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserver" ) =
"smtphost"
objMAIL.Configuration.Fields.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserverp ort") = 25
objMAIL.Configuration.Fields.Update
On Error Resume Next
objMAIL.Send

If Err.Number <> 0 Then

'Wscript.echo "Erreur : " + Cstr(Err.Number) + " ," +
Err.Description
On error goto 0

End if

End Sub

Re: sending mail with images

am 10.12.2006 12:24:26 von giorgio

> set objMAIL = CreateObject("CDO.Message")

Thanks, but it works only on IIS..
Is it possible to use CDONTS and use a web path like this
http://www.google.it/intl/it_it/images/logo.gif to attach an image?

Re: sending mail with images

am 10.12.2006 17:00:03 von Anthony Jones

"Giorgio" wrote in message
news:457bee0c$0$22382$4fafbaef@reader2.news.tin.it...
> > set objMAIL = CreateObject("CDO.Message")
>
> Thanks, but it works only on IIS..

What do you want it to work 'on'?

> Is it possible to use CDONTS and use a web path like this
> http://www.google.it/intl/it_it/images/logo.gif to attach an image?
>

CDONTS is deprecated, why is using CDOSYS a problem?

Re: sending mail with images

am 10.12.2006 21:38:34 von giorgio

> What do you want it to work 'on'?
on a web site that supports asp 3


> CDONTS is deprecated, why is using CDOSYS a problem?
i'm interested in that AttachURL method
objMail.AttachURL Source, ContentLocation
but it works only if "Source" is Server.MapPath ("filename")
and not working if "Source" is a link like http://www...
By the way, which way do you suggest using with CDOSYS?